const db = require('@/db/db-connection')

class ConfigModel {
  async find () {
    try {
      const sql = 'select * from config'
      const data = await db.query(sql)
      return data[0]
    } catch (error) {
      throw new Error(error)
    }
  }

  async findFriendLink () {
    const sql = 'select fl.* from friend_link fl'
    try {
      const data = await db.query(sql)
      return data
    } catch (error) {
      throw new Error(error)
    }
  }
}

module.exports = new ConfigModel()
